package com.xuchang.constant;

public class LoginConstant {
    public static final String ADMIN = "admin";
    public static final String USER = "user";

    public static final String QUERY_ADMIN_SQL = "SELECT id,`password`,`status`,username FROM `sys_user` WHERE username = ?";
    public static final String QUERY_USER_SQL = "SELECT id,`password`,`status`,username FROM `user` WHERE mobile = ? or email = ?";
    public static final String QUERY_ROLE_CODE = "SELECT `code` FROM sys_role LEFT JOIN sys_user_role as ur ON sys_role.id = ur.role_id WHERE ur.user_id= ?";

    public static final String ROLE_ADMIN = "ROLE_ADMIN";
    /**
     * 查询所有的权限名称
     */
    public static final String QUERY_ALL_PERMISSIONS =
            "SELECT `name` FROM sys_privilege";

    public static final String QUERY_USER_PERMISSIONS = "SELECT `name` FROM sys_privilege LEFT JOIN sys_role_privilege_user rpu ON sys_privilege.id = rpu.id WHERE rpu.user_id= ?";

    public  static  final  String REFRESH_TYPE = "REFRESH_TOKEN" ;

    public static final String QUERY_ADMIN_USER_WITH_ID = "SELECT username from sys_user WHERE id= ?";

    public static  final  String QUERY_MEMBER_USER_WITH_ID = "SELECT `mobile` FROM user where id = ?";

}
